package org.eiahe.hr.attendance.event;

import lombok.Getter;
import org.springframework.context.ApplicationEvent;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 年假扣减事件
 * 当请假申请通过后触发此事件
 *
 * @author zhangnn
 */
@Getter
public class AnnualLeaveDeductEvent extends ApplicationEvent {

    /**
     * 工号
     */
    private final String employeeNo;

    /**
     * 年份
     */
    private final Integer year;

    /**
     * 扣减天数
     */
    private final BigDecimal days;

    /**
     * 请假单号
     */
    private final String leaveNo;

    /**
     * 事件时间
     */
    private final LocalDateTime eventTime;

    public AnnualLeaveDeductEvent(Object source, String employeeNo, Integer year,
            BigDecimal days, String leaveNo) {
        super(source);
        this.employeeNo = employeeNo;
        this.year = year;
        this.days = days;
        this.leaveNo = leaveNo;
        this.eventTime = LocalDateTime.now();
    }
}
